package com.jeesite.modules.kj.file.utils;

import java.io.File;
import java.io.FileOutputStream;

public class FileUtils {
    public static String uploadFile(byte[] file, String baseDir,String filePath ,String fileName) throws Exception {
        File targetFile = new File(baseDir + "/" + filePath);
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out = new FileOutputStream(baseDir + "/" + filePath + fileName);
        out.write(file);
        out.flush();
        out.close();
        return filePath+fileName;
    }

}
